import { Component, OnInit, OnDestroy } from '@angular/core';
import {MessagesService} from '../../services/messages.service';
import {BreadcrumbService} from '../../services/breadcrumb.service';
import {ToasterService,ToasterModule} from 'angular2-toaster';

@Component({
  selector: 'app-home',
  styleUrls: ['./home.component.css'],
  templateUrl: './home.component.html'
})
export class HomeComponent implements OnInit, OnDestroy {
  public date: Date = new Date();

  constructor(
    private msgServ: MessagesService,
    private breadServ: BreadcrumbService,
    private toasterService: ToasterService
  ) {
  }

  public ngOnInit() {
    // setttings the header for the home
    this.breadServ.setCurrent({
      description: '首页',
      display: true,
      header: 'Dashboard',
      levels: [
        {
          icon: 'dashboard',
          link: ['/'],
          title: '首页'
        }
      ]
    });
    this.toasterService.pop('success', 'Args Title', 'Args Body');

  }

  public ngOnDestroy() {
    // removing the header
    this.breadServ.clear();
  }

}
